﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TabPageAdapter.cs" company="">
//   
// </copyright>
// <summary>
//   The tab page adapter.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.Adapters
{
    using System.Windows.Forms;

    using Libium.Views;

    /// <summary>
    /// The tab page adapter.
    /// </summary>
    public class TabPageAdapter : ControlAdapter<TabPage>, INamedItemView
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TabPageAdapter"/> class.
        /// </summary>
        /// <param name="page">
        /// The page.
        /// </param>
        public TabPageAdapter(TabPage page)
            : base(page)
        {
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets the item view.
        /// </summary>
        public object ItemView
        {
            get
            {
                return Control.Controls[0];
            }
        }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        public string Name
        {
            get
            {
                return Control.Text;
            }

            set
            {
                Control.Text = value;
            }
        }

        #endregion
    }
}